package com.yehongyu.mytools.ui.swing;

//: Progress.java
//Using progress bars and sliders
import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JSlider;
import javax.swing.border.TitledBorder;

public class Progress extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	JProgressBar pb = new JProgressBar();

	JSlider sb = new JSlider(JSlider.HORIZONTAL, 0, 100, 60);

	public Progress() {
		setLayout(new GridLayout(2, 1));
		add(pb);
		sb.setValue(0);
		sb.setPaintTicks(true);
		sb.setMajorTickSpacing(20);
		sb.setMinorTickSpacing(5);
		sb.setBorder(new TitledBorder("Slide Me"));
		pb.setModel(sb.getModel()); // Share model
		add(sb);
	}

	public static void main(String args[]) {
		Show.inFrame(new Progress(), 200, 150);
	}
} // /:~
